import { Application, Session } from "mydog";
import roomManager from "../../../app/roomManager";
import { room_msg } from "../../../config/proto/room";

export default class Handler {
  private app: Application;
  constructor(app: Application) {
    this.app = app;
  }

  public async createRoom(msg: room_msg.c2s_create, session: Session, next: Function) {

  }

  public playerAction(msg: room_msg.c2s_playerAction, session: Session) {
    const uid = session.uid;
    const rid = session.get('rid');
    const action = msg.action;

    if (!!!uid) { return; }

    roomManager.onPlayerAction(rid, uid, action);
  }


}
